<?
/**
 * class <b>Hli_TrackingResponseType Class</b>
 * Published 12/09/2011 15:58:19
 *
 * @author Lars Sorhus (lars@saucecode.com.au)
 * @copyright sauceCode Pty Ltd.
 * @version 2.0.5.105.
 * @internal It's not recommended at all to modify this code.
 */
class Hli_TrackingResponseType extends Hli_Serializer{
	/**
    * Constructor
    */
   public function  __construct(){
		parent::__construct();
	}

	/**
    * Sets the response object.
    *
	 * @method setRequestObject
	 * @param Array
	 * @return void
	 */
	public function setResponseObject($value){
		$this->__response=$value;
		$this->setAck($value["Ack"]);
		$this->setHAWB($value["HAWB"]);
		$TrackingArray=new Hli_TrackingArray($value["TrackingArray"]["Tracking"]);
		$this->setCurrentStatus($TrackingArray->getItemAt(0));
		$this->setTrackingArray($TrackingArray);
		//Loop Through Errors
		if(count($value["ErrorArray"]["Errors"])>0){
			for($c=0;$c<count($value["ErrorArray"]["Errors"]);$c++){
				$err=$value["ErrorArray"]["Errors"][$c];
				$this->addError(new Hli_ErrorType($err["Code"],$err["Message"],$err["Severity"]));
			}
		}
	}

	/**
    * Gets the House Airway Bill (HAWB)
    *
	 * @method getHAWB
	 * @return string
	 */
	public function getHAWB(){
		return($this->__response["HAWB"]);
	}
	/**
    * Sets the House Airway Bill (HAWB)
    *
	 * @method getHAWB
	 * @return string
	 */
	public function setHAWB($value){
		$this->__response["HAWB"]=$value;
	}

	/**
    * Gets the current status of the item.
    *
	 * @method getCurrentStatus
	 * @return Hli_TrackingStatus
	 */
	public function getCurrentStatus(){
		return($this->__response["CurrentStatus"]);
	}
	/**
    * Sets the current status of the item.
    *
	 * @method setCurrentStatus
	 * @param Hli_TrackingStatus
	 * @return void
	 */
	public function setCurrentStatus($value){
		$this->__response["CurrentStatus"]=$value;
	}

	/**
    * Gets the tracking array structure.
    *
	 * @method getTrackingArray
	 * @return Hli_TrackingArray
	 */
	public function getTrackingArray(){
		return($this->__response["TrackingArray"]);
	}
	/**
    * Sets the tracking array structure.
    *
	 * @method setTrackingArray
	 * @param Hli_TrackingArray
	 * @return void
	 */
	public function setTrackingArray($value){
		$this->__response["TrackingArray"]=$value;
	}
}
?>
